package com.tj.collection.db.dao.impl;
import com.fqgj.common.base.AbstractBaseMapper;
import com.google.common.collect.Maps;
import com.tj.collection.db.dao.ChatterWorkSettingDao;
import com.tj.collection.db.dbo.ChatterWorkSettingDBO;
import com.tj.collection.db.entity.ChatterWorkSettingEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;

/**
* User: linqu
* Date: 2023-10-23
* Time: 19:19:17.359
*/

@Repository
public class ChatterWorkSettingDaoImpl extends AbstractBaseMapper<ChatterWorkSettingEntity> implements ChatterWorkSettingDao {

    @Override
    public List<ChatterWorkSettingDBO> listChatterWorkingSet(List<String> userCodes) {
        final HashMap<String, Object> params = Maps.newHashMap();
        params.put("list", userCodes);
        return this.getSqlSession().selectList(this.getStatement("listChatterWorkingSet"), params);
    }

    @Override
    public ChatterWorkSettingEntity getChatterWorkingSet(String userCode) {
        return this.getSqlSession().selectOne(this.getStatement("getChatterWorkingSet"), userCode);
    }

    @Override
    public List<ChatterWorkSettingDBO> listAllChatterWorkingSet() {
        return this.getSqlSession().selectList(this.getStatement("listAllChatterWorkingSet"));
    }

    @Override
    public List<ChatterWorkSettingEntity> listWaitingTransferData() {
        return this.getSqlSession().selectList(this.getStatement("listWaitingTransferData"));
    }

    @Override
    public List<ChatterWorkSettingEntity> listChatterWorkingSetByChatterCode(List<String> chatterCodes) {
        final HashMap<String, Object> params = Maps.newHashMap();
        params.put("list", chatterCodes);
        return this.getSqlSession().selectList(this.getStatement("listChatterWorkingSetByChatterCode"), params);
    }
}